package top.zywork.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import top.zywork.dao.GoodsAgentDAO;
import top.zywork.dos.GoodsAgentDO;
import top.zywork.dto.GoodsAgentDTO;
import top.zywork.service.AbstractBaseService;
import top.zywork.service.GoodsAgentService;

import javax.annotation.PostConstruct;

/**
 * GoodsAgentServiceImpl服务接口实现类<br/>
 *
 * 创建于2019-07-24<br/>
 *
 * @author http://zywork.top 王振宇
 * @version 1.0
 */
@Service(value = "goodsAgentService")
public class GoodsAgentServiceImpl extends AbstractBaseService implements GoodsAgentService {

    private GoodsAgentDAO goodsAgentDAO;

    @Autowired
    public void setGoodsAgentDAO(GoodsAgentDAO goodsAgentDAO) {
        super.setBaseDAO(goodsAgentDAO);
        this.goodsAgentDAO = goodsAgentDAO;
    }

    @PostConstruct
    public void init() {
        super.init(GoodsAgentDO.class, GoodsAgentDTO.class);
    }

    @Override
    public int updateActiveByOtherId(Long shopId, Long goodsId, Long goodsSkuId, byte isActive) {
        return goodsAgentDAO.updateActiveByOtherId(shopId, goodsId, goodsSkuId, isActive);
    }
}
